CC = gcc
CCOPTS = -c -g -Wall
LINKOPTS = -g 
#LINKOPTS = -g -lrt 


EXEC=memtest memplay
OBJECTS=testrunner.o mymem.o memorytests.o

all: memtest memplay

memplay: mymem.o memplay.o


memtest: $(OBJECTS)
	$(CC) $(LINKOPTS) -o $@ $^


%.o:%.c
	$(CC) $(CCOPTS) -o $@ $^

clean:
	- $(RM) $(EXEC)
	- $(RM) *.o *.log
	- $(RM) *~
	- $(RM) core.*

test: memtest
	./memtest -f0 all all

stage1-test: memtest
	./memtest -f0 all first

pretty: 
	indent *.c *.h -kr
